{include file='common/header'}
<div class="container">
    <div class="row">
        <div class="hy-cascade clearfix">
            <div class="content-meun clearfix">
                <div class="item">
                    <ul class="clearfix">
                        <li class="text"><span class="text-muted">按剧情</span></li>
                        <li><a  class="{if input('movie_type')==''}active{/if}" href="javascript:search('movie_type','');">全部</a></li>

                        {foreach $types as $v}
                        <li><a href="javascript:search('movie_type','{$v.id}');" class="{if input('movie_type')==$v['id']}active{/if}">{$v.type_name}</a></li>
                        {/foreach}
                    </ul>
                    <ul class="clearfix">
                        <li class="text"><span class="text-muted">按地区</span></li>
                        <li><a href="javascript:search('region_id','');" class="{if input('region_id')==''}active{/if}">全部</a></li>

                        {foreach $regions as $v}
                        <li><a href="javascript:search('region_id','{$v.id}');" class="{if input('region_id')==$v['id']}active{/if}">{$v.region_name}</a></li>
                        {/foreach}
                    </ul>
                    <ul class="clearfix">
                        <li class="text"><span class="text-muted">按年份</span></li>
                        <li>
                            <a href="javascript:search('movie_year','');" class="{if input('movie_year')==''}active{/if}">全部</a></li>


                        {foreach $years as $v}
                        <li><a href="javascript:search('movie_year','{$v}');" class="{if input('movie_year')==$v}active{/if}">{$v}</a></li>
                        {/foreach}
                        <li><a href="javascript:search('movie_year','more');" class="{if input('movie_year')=='more'}active{/if}">更早</a></li>


                    </ul>
                </div>
            </div>
        </div>
        <div class="hy-layout clearfix" style="margin-top: 0;">
            <div class="hy-switch-tabs active clearfix"><span class="text-muted pull-right hidden-xs">共有<span
                    class="text-color">“{$total}”</span>个影片,当前第<span class="text-color">“{:input('page')?:1}”</span>页</span>
                <ul class="nav nav-tabs">
                    <li class="{if input('rank')=='time' || empty(input('rank'))}active{/if}"><a  href="javascript:search('rank','time');">按时间</a></li>
                    <li class="{if input('rank')=='pv'}active{/if}"><a  href="javascript:search('rank','pv');">按人气</a></li>
                    <li class="{if input('rank')=='hot'}active{/if}"><a  href="javascript:search('rank','hot');">按推荐</a></li>
                </ul>
            </div>
            <form action="" method="get">
                <input type="hidden" name="movie_type" value="{:input('movie_type')}">
                <input type="hidden" name="movie_year" value="{:input('movie_year')}">
                <input type="hidden" name="region_id" value="{:input('region_id')}">
                <input type="hidden" name="rank" value="{:input('rank')}">
            </form>
            <div class="hy-video-list">
                <div class="item">
                    <ul class="clearfix">
                        {foreach $movies as $k=>$v}
                        <li class="col-md-2 col-sm-3 col-xs-4 ">
                            <a class="videopic lazy" href="{:url('/details',['movie_id'=>$v['id']])}" title="{$v.title}"
                               data-original="{$v.poster}"
                               style="background: url(/index/images/load.gif) no-repeat; background-position:50% 50%; background-size: cover;"><span
                                    class="play hidden-xs"></span><span class="score">{$v.grade}</span><span
                                    class="note textbg">{$v.resolution}</span></a>
                            <div class="title">
                                <h5 class="text-overflow"><a href="{:url('/details',['movie_id'=>$v['id']])}" title="{$v.title}">{$v.title}</a>
                                </h5>
                            </div>
                            <div class="subtitle text-muted text-muted text-overflow hidden-xs">
                                {$v.actors}
                            </div>
                        </li>
                        {/foreach}

                    </ul>
                </div>

                {if count($movies)==0}
                    <p style="text-align: center">暂无内容</p>
                {/if}
            </div>
            <div class="hy-page clearfix">
                {$movies|raw}
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    function search(key,val){

        $('input[name='+key+']').val(val);

        $('form').submit();
    }

    var w = document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth;
    if (w > 640) {
        $(".collapse").addClass("in");
    } else {
        $(".content-meun").css("min-height", "100%");
    }
</script>
{include file='common/foot'}
